package com.api.rc.lobby;

import com.api.rc.lobby.domain.LobbyRoom;
import com.api.user.vo.UserInfoVo;
import org.springframework.web.socket.WebSocketSession;

/**
 * 游戏大厅管理器
 *
 * @author RenQiang
 * @date 2021/7/13
 */
public interface LobbyManager {

    /**
     * 创建游戏大厅房间
     *
     * @param roomId
     * @param hostUserId
     * @param teamCount
     * @param membersPerTeam
     */
    void createRoom(Long roomId, long hostUserId, int teamCount, int membersPerTeam);

    /**
     * 获取大厅房间
     *
     * @param roomId
     * @return
     */
    LobbyRoom getLobbyRoom(Long roomId);

    /**
     * 销毁房间（游戏开始后）
     *
     * @param roomId
     * @param remark
     */
    void destroyRoom(Long roomId, String remark);

    /**
     * 加入房间
     *
     * @param userInfo
     * @param roomId
     * @param session
     */
    void joinRoom(UserInfoVo userInfo, Long roomId, WebSocketSession session);

    /**
     * 退出房间
     *
     * @param userId
     */
    void exitRoom(Long userId);

    /**
     * 加入队伍
     *
     * @param userId
     * @param teamNo
     */
    void joinTeam(Long userId, int teamNo);

    /**
     * 玩家准备
     *
     * @param userId
     */
    void readyToGame(Long userId);
}
